package inf102.java.part2;

import inf102.java.part2.generatedFiles.ExerciseMessage.Exercise;

import java.io.File;
import java.io.FileInputStream;
import java.util.Scanner;

public class Reader {
	
	public static void main(String [] args) throws Exception {
		Scanner scanner = new Scanner(System.in);
		System.out.println("--------------------------Enter A File-------------------------");
		System.out.println("Enter the full path of the file you would like to read from: ");
		File file = new File(scanner.nextLine());
		
		FileInputStream inputFile = new FileInputStream(file);
		Exercise exercise = Exercise.parseFrom(inputFile);
		inputFile.close();
		System.out.println(exercise);
		
		System.out.println("Exercise performed: " + ", ID: " + ", Description: ");
		System.out.println("Total duration of all cardio exercises performed: ");
		System.out.println("Total duration of all cardio exercises performed (intensity >= 6): ");
		System.out.println("Total duration of all cardio exercises performed (intensity <= 5): ");
		System.out.println("Longest cardio exercise performed - ID: " + ", Description: " + ", Duration: ");
		
		System.out.println("Total number of sets performed in the weight training exercises: ");
		System.out.println("Total number of repetitions performed in the weight training exercises: ");
		System.out.println("Weight training exercise with largest total number of repetitions - ID: " 
				+ ", Description: " 
				+ ", Total number of repetitions: ");
		
		System.out.println("Total hold duration of the stretching exercises performed:");
		System.out.println("Stretching exercise with longest total hold duration across all its repetitions - " +
				"ID: " + ", Description: " + ", Hold Duration: ");
	}
}
